package com.proton.carepatchtemp.database.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.proton.carepatchtemp.database.table.Profile;
import com.proton.carepatchtemp.database.table.HealthTip;
import com.proton.carepatchtemp.database.table.Msg;
import com.proton.carepatchtemp.database.table.Device;

import com.proton.carepatchtemp.database.gen.ProfileDao;
import com.proton.carepatchtemp.database.gen.HealthTipDao;
import com.proton.carepatchtemp.database.gen.MsgDao;
import com.proton.carepatchtemp.database.gen.DeviceDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig profileDaoConfig;
    private final DaoConfig healthTipDaoConfig;
    private final DaoConfig msgDaoConfig;
    private final DaoConfig deviceDaoConfig;

    private final ProfileDao profileDao;
    private final HealthTipDao healthTipDao;
    private final MsgDao msgDao;
    private final DeviceDao deviceDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        profileDaoConfig = daoConfigMap.get(ProfileDao.class).clone();
        profileDaoConfig.initIdentityScope(type);

        healthTipDaoConfig = daoConfigMap.get(HealthTipDao.class).clone();
        healthTipDaoConfig.initIdentityScope(type);

        msgDaoConfig = daoConfigMap.get(MsgDao.class).clone();
        msgDaoConfig.initIdentityScope(type);

        deviceDaoConfig = daoConfigMap.get(DeviceDao.class).clone();
        deviceDaoConfig.initIdentityScope(type);

        profileDao = new ProfileDao(profileDaoConfig, this);
        healthTipDao = new HealthTipDao(healthTipDaoConfig, this);
        msgDao = new MsgDao(msgDaoConfig, this);
        deviceDao = new DeviceDao(deviceDaoConfig, this);

        registerDao(Profile.class, profileDao);
        registerDao(HealthTip.class, healthTipDao);
        registerDao(Msg.class, msgDao);
        registerDao(Device.class, deviceDao);
    }
    
    public void clear() {
        profileDaoConfig.clearIdentityScope();
        healthTipDaoConfig.clearIdentityScope();
        msgDaoConfig.clearIdentityScope();
        deviceDaoConfig.clearIdentityScope();
    }

    public ProfileDao getProfileDao() {
        return profileDao;
    }

    public HealthTipDao getHealthTipDao() {
        return healthTipDao;
    }

    public MsgDao getMsgDao() {
        return msgDao;
    }

    public DeviceDao getDeviceDao() {
        return deviceDao;
    }

}
